package com.dawn.trademanage.bean;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import com.dawn.usermanage.bean.UserBean;

/**
 * The persistent class for the tt_tradeinfo database table.
 * 
 */
@Entity
@Table(name = "tt_tradeinfo")
public class TradeInfoBean implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long tradeId;

	@Temporal(TemporalType.TIMESTAMP)
	private Calendar lastBeginTime;

	private byte isStop = 1;

	private int unitPrice;

	private int creditRate;

	private long balance;
	@Version
	private int version;

	// bi-directional many-to-one association to TradedetailBean
	@OneToMany(mappedBy = "ttTradeinfo")
	private Set<TradeDetailBean> ttTradedetails;

	// bi-directional many-to-one association to TradedetailBean
	@OneToMany(mappedBy = "ttTradeinfo")
	private Set<TradeHistoryBean> ttTradeHistory;

	@OneToOne(mappedBy = "ttTradeinfo")
	private UserBean tuUserinfo;

	public long getTradeId() {
		return this.tradeId;
	}

	public void setTradeID(long tradeId) {
		this.tradeId = tradeId;
	}

	public Calendar getLastBeginTime() {
		return this.lastBeginTime;
	}

	public void setLastBeginTime(Calendar lastBeginTime) {
		this.lastBeginTime = lastBeginTime;
	}

	public byte getIsStop() {
		return this.isStop;
	}

	public void setIsStop(byte isStop) {
		this.isStop = isStop;
	}

	public int getUnitPrice() {
		return this.unitPrice;
	}

	public void setUnitPrice(int unitPrice) {
		this.unitPrice = unitPrice;
	}

	public Set<TradeDetailBean> getTtTradedetails() {
		return this.ttTradedetails;
	}

	public void setTtTradedetails(Set<TradeDetailBean> ttTradedetails) {
		this.ttTradedetails = ttTradedetails;
	}

	public int getCreditRate() {
		return creditRate;
	}

	public void setCreditRate(int creditRate) {
		this.creditRate = creditRate;
	}

	public UserBean getTuUserinfo() {
		return tuUserinfo;
	}

	public void setTuUserinfo(UserBean tuUserinfo) {
		this.tuUserinfo = tuUserinfo;
	}

	public long getBalance() {
		return balance;
	}

	public void setBalance(long balance) {
		this.balance = balance;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
}
